package logic

import (
	"context"
	"shop/model/redis"

	"shop/goods"
	"shop/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type CartCheckedLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewCartCheckedLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CartCheckedLogic {
	return &CartCheckedLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *CartCheckedLogic) CartChecked(in *goods.CartCheckedRequest) (*goods.CartCheckedResponse, error) {
	// todo: add your logic here and delete this line
	err := redis.CartChecked(in.UserId)
	if err != nil {
		logx.Error("全选失败")
		return nil, err
	}
	return &goods.CartCheckedResponse{}, nil
}
